package Exceptions;

import be.kuleuven.cs.som.annotate.Basic;
import be.kuleuven.cs.som.annotate.Immutable;
import Dungeon.Dungeon;

/**
 * A class that signals exceptions for invalid dimensions for a dungeon
 * Every exception contains the illegal dimension and the dungeon
 * 
 * @author Pieter & An
 *
 */

public class IllegalDimensionException extends Exception {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	/**
	 * A variable to store the dimension that triggers the illegal dimension exception
	 */
	private long dimension;
	/**
	 * A variable to store the dungeon for the illegal dimension exception
	 */
	private Dungeon dungeon;
	
	/**
	 * Initialize the new illegal dimension exception with given dimension and dungeon
	 * @param 	dimension
	 * 			the dimension that triggers the exception
	 * @param 	dungeon
	 * 			the dungeon for the exception
	 * @post	...
	 * 			|new.getDimension() = dimension
	 * @post	...
	 * 			|new.getDungeon() = dungeon
	 */
	public IllegalDimensionException(long dimension, Dungeon dungeon) {
		this.dimension = dimension;
		this.dungeon = dungeon;
	}

	
	/**
	 * Initialize the new illegal dimension exception with given dungeon
	 * 
	 * @param 	dungeon
	 * 			
	 * @post	...
	 * 			|new.getDungeon()= dungeon
	 */
	public IllegalDimensionException(Dungeon dungeon) {
		this.dungeon = dungeon;
	}



	public IllegalDimensionException() {
		this(null);
	}


	/**
	 * Returns the dimension that triggers the illegal dimension exception
	 */
	@Basic @Immutable
	public long getDimension() {
		return dimension;
	}

	/**
	 * Returns the dungeon that belongs to the illegal dimension exception
	 */
	@Basic @Immutable
	public Dungeon getDungeon() {
		return dungeon;
	}

	

}
